import axios from "axios"

let myAxios = axios.create({
    baseURL:"http://forum.atguigu.cn"
})

//前端发送的请求拦截
myAxios.interceptors.request.use(
    (req)=>{
        req.headers.access_token="mytoken"
        return req;
    },
    (err)=>{
        
    }
)

//响应拦截
myAxios.interceptors.response.use(
    (resp)=>{
        return resp.data;
    },
    (err)=>{
        Promise.reject(err);
    }
)










export default myAxios;